// ignore_for_file: depend_on_referenced_packages

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:retrofit/http.dart';
import 'package:dio/dio.dart';

import 'Initial.dart';

part 'NotificationApi.g.dart';
part 'NotificationApi.freezed.dart';

@RestApi()
abstract class NotificationApi {

  factory NotificationApi(Dio dio, {String baseUrl}) = _NotificationApi;

  @GET("notifications")
  Future<List<UnconsumedNotification>> getUnconsumedNotifications();

}

enum NotificationType{
  SUBMITTED_MARKET_ORDER,
}

@freezed
class UnconsumedNotification with _$UnconsumedNotification{

  const factory UnconsumedNotification({
    required int id,
    required NotificationType type,
    Object? data,
  }) = _UnconsumedNotification;

  const UnconsumedNotification._();

  factory UnconsumedNotification.fromJson(Map<String, dynamic> json) => _$UnconsumedNotificationFromJson(json);

}


late NotificationApi notificationApi = NotificationApi(dio, baseUrl: baseUrl);
